<%--
  Created by IntelliJ IDEA.
  User: 10171225
  Date: 2016/6/20
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>"/>
    <title>双色球管理</title>
    <link rel="stylesheet" href="static/themes/bootstrap/easyui.css">
    <link rel="stylesheet" href="static/css/base.css">
    <script src="static/javascript/jquery-1.11.3.min.js"></script>
    <script src="static/javascript/jquery.easyui.min.js"></script>
    <script src="static/javascript/utils.js"></script>
    <script src="static/javascript/base.js"></script>

    <link rel="stylesheet" href="plugins/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="plugins/bootstrap-3.3.5-dist/css/bootstrap-theme.min.css">
    <script src="plugins/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <script type="text/javascript" language="JavaScript">
        $(document).ready(function(){
            var main = "#main"
            $(".deleteDoubleColorBall").click(function () {
                if(confirm("是否确认删除？")) {
                    obj=$.ajax({url:"admin/doubleColorBallManage/doubleColorBallDelete?doubleColorBallId=" + $(this).attr("name"),async:false});
                    $(main).html(obj.responseText);
                    $("#doubleColorBallManage").click();
                }
            });
            $("#search").click(function () {
                var text = $("#searchInput").val();
                if("" == ($.trim(text))) {
                    alert("搜索内容不可以为空");
                } else {
                    obj=$.ajax({url:"admin/doubleColorBallManage/doubleColorBallSearch?text=" + encodeURI(encodeURI(text)), async:false});
                    $(main).html(obj.responseText);
                }
            });

            $("#addNewDoubleColorBall").click(function () {
                $(main).load("views/admin/doubleColorBallManage/doubleColorBallCreate.jsp");
            });

            $(".doubleColorBallEdit").click(function () {
                obj=$.ajax({url:"admin/doubleColorBallManage/doubleColorBallEdit?doubleColorBallId=" + $(this).attr("name"), async:false});
                $(main).html(obj.responseText);
            });

        });
    </script>
</head>
<body>
<div>
    <div class="articleHead">
        <input id="searchInput" name="searchInput" class="searchInput" type="text" placeholder="搜索期号..." value="${searchInput}"/>&nbsp;
        <button id="search">搜索</button>
    </div>
    <div class="articleList">
        <table>
            <col span="1" width="5%"/>
            <col span="1" width="15%"/>
            <col span="2" width="5%"/>
            <col span="1" width="20%"/>
            <col span="1" width="10%"/>
            <col span="2" width="5%"/>
            <tr>
                <th>期号</th>
                <th>红球</th>
                <th>篮球</th>
                <th>奖金池</th>
                <th>中奖信息</th>
                <th>发布日期</th>
                <th>编辑</th>
                <th>删除</th>
            </tr>
            <c:forEach items="${doubleColorBallList}" var="doubleColorBall" varStatus="vs">
                <tr>
                    <td>${doubleColorBall.issue}</td>
                    <td>
                        ${doubleColorBall.redOne}&nbsp;${doubleColorBall.redTwo}&nbsp;
                        ${doubleColorBall.redThree}&nbsp;${doubleColorBall.redFour}&nbsp;
                        ${doubleColorBall.redFive}
                    </td>
                    <td>${doubleColorBall.blue}</td>
                    <td>${doubleColorBall.currentPrizePool}</td>
                    <td>${doubleColorBall.prizeInfo}</td>
                    <td><spring:eval expression="doubleColorBall.drawDate"></spring:eval></td>
                    <td><a class="doubleColorBallEdit" name="${doubleColorBall.id}">编辑</a></td>
                    <td><a class="deleteDoubleColorBall" name="${doubleColorBall.id}">删除双色球</a></td>
                </tr>
            </c:forEach>
        </table>
    </div>
    <div>
        <button id="addNewDoubleColorBall">新增双色球</button>
    </div>

</div>
</body>
</html>